<script setup>
defineProps({
  data: {
    type: Array,
    default: () => []
  },
  columns: {
    type: Array,
    default: () => []
  }
})
const dialogVisible = defineModel()
</script>

<template>
  <el-dialog v-model="dialogVisible" width="768px" v-bind="$attrs">
    <el-table
      :data="data"
      style="width: 100%"
      :cell-style="{
        textAlign: 'center'
      }"
      :header-cell-style="{
        textAlign: 'center'
      }"
      align="center"
    >
      <el-table-column type="index" label="序号" width="55" fixed="left" />
      <el-table-column
        v-for="column in columns"
        :key="column.prop"
        :prop="column.prop"
        :label="column.label"
      />
    </el-table>
    <template #footer>
      <el-button @click="dialogVisible = false"> 关闭 </el-button>
    </template>
  </el-dialog>
</template>
